package ch.unifr.diuf.webeng.taskmap.db;

import java.util.Date;
import java.util.List;

public class TestDB1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TaskMapDAO d = TaskMapDAO.getInstance();
		Task t1 = new Task("ivan", 1, "Exam", "Wall Street 1", new Date(), "12:00", "13:00");
//		Task t2 = new Task("ivan", 2, "Presentation", "Wall Street 2", new Date(), "15:00", "16:00");
//		d.saveTask(t1);
//		d.saveTask(t2);
//		d.registerUser("ivan", "password");
		System.out.println(d.getRegisteredUser("ivan", "password"));
		List<Task> l = d.getTasksByUser("ivan");
		for(Task tt:l){
			System.out.println(tt);
		}
		t1.setTaskTitle("Ai da vidim sega");
		t1.setTaskDate(new Date());
//		d.updateTask(t1);
		System.out.println("by date:");
//		List<Task> li = d.getTasksBetweenDates("ivan", new Date(110,11,3), new Date(110,11,23));
		List<Task> li = d.getTasksByUser("ivan");
		for(Task tt:li){
			System.out.println(tt);
		}
	
	}

}
